//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;


	/// <summary>
	/// </summary>
	public class BinhLuan_BA
	{
		public BinhLuan_BA() {}
#region 'Variables And Properties'
		 private int int_IdBinhLuan ;
		 public int IdBinhLuan
			{
			 get 	
				{
					 return this.int_IdBinhLuan;
				}
			 set 	
				{
					int_IdBinhLuan=value;
				}
			}
		 private int int_IdTinTuc ;
		 public int IdTinTuc
			{
			 get 	
				{
					 return this.int_IdTinTuc;
				}
			 set 	
				{
					int_IdTinTuc=value;
				}
			}
		 private string string_TieuDe ;
		 public string TieuDe
			{
			 get 	
				{
					 return this.string_TieuDe;
				}
			 set 	
				{
					string_TieuDe=value;
				}
			}
		 private string string_TenDayDu ;
		 public string TenDayDu
			{
			 get 	
				{
					 return this.string_TenDayDu;
				}
			 set 	
				{
					string_TenDayDu=value;
				}
			}
		 private string string_Email ;
		 public string Email
			{
			 get 	
				{
					 return this.string_Email;
				}
			 set 	
				{
					string_Email=value;
				}
			}
		 private string string_NoiDung ;
		 public string NoiDung
			{
			 get 	
				{
					 return this.string_NoiDung;
				}
			 set 	
				{
					string_NoiDung=value;
				}
			}
		 private DateTime DateTime_NgayTao ;
		 public DateTime NgayTao
			{
			 get 	
				{
					 return this.DateTime_NgayTao;
				}
			 set 	
				{
					DateTime_NgayTao=value;
				}
			}
		 private bool bool_TrangThai ;
		 public bool TrangThai
			{
			 get 	
				{
					 return this.bool_TrangThai;
				}
			 set 	
				{
					bool_TrangThai=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the BinhLuan table.
		/// <summary>
		/// <param name="IdBinhLuan"></param>
		/// <param name="IdTinTuc"></param>
		/// <param name="TieuDe"></param>
		/// <param name="TenDayDu"></param>
		/// <param name="Email"></param>
		/// <param name="NoiDung"></param>
		/// <param name="NgayTao"></param>
		/// <param name="TrangThai"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			BinhLuan_DA clsDA_BinhLuan = new BinhLuan_DA();
			clsDA_BinhLuan.IdBinhLuan=int_IdBinhLuan;
			clsDA_BinhLuan.IdTinTuc=int_IdTinTuc;
			clsDA_BinhLuan.TieuDe=string_TieuDe;
			clsDA_BinhLuan.TenDayDu=string_TenDayDu;
			clsDA_BinhLuan.Email=string_Email;
			clsDA_BinhLuan.NoiDung=string_NoiDung;
			clsDA_BinhLuan.NgayTao=DateTime_NgayTao;
			clsDA_BinhLuan.TrangThai=bool_TrangThai;

			boolInsert = clsDA_BinhLuan.Insert(SqlCnn);
			clsDA_BinhLuan = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the BinhLuan table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			BinhLuan_DA clsDA_BinhLuan = new BinhLuan_DA();
			DataTable dt = new DataTable();
			dt=clsDA_BinhLuan.Select(SqlCnn);
			clsDA_BinhLuan= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the BinhLuan table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			BinhLuan_DA clsDA_BinhLuan = new BinhLuan_DA();
			DataTable dt = new DataTable();
			clsDA_BinhLuan.IdBinhLuan=int_IdBinhLuan;

			dt=clsDA_BinhLuan.SelectPrimaryKey(SqlCnn);
			clsDA_BinhLuan= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the BinhLuan table.
		/// <summary>
		/// <param name="IdBinhLuan"></param>
		/// <param name="IdTinTuc"></param>
		/// <param name="TieuDe"></param>
		/// <param name="TenDayDu"></param>
		/// <param name="Email"></param>
		/// <param name="NoiDung"></param>
		/// <param name="NgayTao"></param>
		/// <param name="TrangThai"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			BinhLuan_DA clsDA_BinhLuan = new BinhLuan_DA();
			clsDA_BinhLuan.IdBinhLuan=int_IdBinhLuan;
			clsDA_BinhLuan.IdTinTuc=int_IdTinTuc;
			clsDA_BinhLuan.TieuDe=string_TieuDe;
			clsDA_BinhLuan.TenDayDu=string_TenDayDu;
			clsDA_BinhLuan.Email=string_Email;
			clsDA_BinhLuan.NoiDung=string_NoiDung;
			clsDA_BinhLuan.NgayTao=DateTime_NgayTao;
			clsDA_BinhLuan.TrangThai=bool_TrangThai;

			boolUpdate = clsDA_BinhLuan.Update(SqlCnn);
			clsDA_BinhLuan = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the BinhLuan table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			BinhLuan_DA clsDA_BinhLuan = new BinhLuan_DA();
			clsDA_BinhLuan.IdBinhLuan=int_IdBinhLuan;

			boolDelete = clsDA_BinhLuan.Delete(SqlCnn);
			clsDA_BinhLuan = null ;
			return boolDelete;
		}
	}

